package com.kj.tms.pri.system.menu.service;

import com.kj.tms.common.bean.dto.TreeData;
import com.kj.tms.pri.system.menu.dto.CommonModuleDto;
import com.kj.tms.pri.system.menu.dto.ModuleDto;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author: wangguoqing
 * @Description: 人员常用功能业务类
 * @Date: Created in 15:02 2017/10/30
 * @Company: 北京宏图天安
 * @Version: 2017/10/30
 * @Modified By:
 */
public interface CommonModuleService {

    static final  String BASE_URL = "/api/system/permission";
    /**
     * @Title: getCurrentMenu
     * @Description: 获取模块树加载数据
     * @return void 返回类型
     * @throws Exception
     */
    @RequestMapping(value = BASE_URL+"/getCurrentMenu",method = RequestMethod.POST )
    List<TreeData> getCurrentMenu();
    /**
     * @Title: listCurrentCommonMenu
     * @Description: 查询当前常用功能
     * @param commonModuleDto
     * @return void 返回类型
     * @throws Exception
     */
    @RequestMapping(value = BASE_URL+"/listCurrentCommonMenu",method = RequestMethod.POST ,consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE})
    List<ModuleDto> listCurrentCommonMenu(@RequestBody(required = false) CommonModuleDto commonModuleDto);

    /**
     * @Title: saveModuleCommon
     * @Description: 添加常用功能
     * @param commonModuleDto
     * @param menuCodes 多个menuCode  以','分开
     * @return void 返回类型
     * @throws Exception
     */
    @RequestMapping(value = BASE_URL+"/saveModuleCommon",method = RequestMethod.POST ,consumes = {MediaType.APPLICATION_JSON_UTF8_VALUE})
    void saveModuleCommon(@RequestParam("menuCodes") String menuCodes,
                          @RequestBody(required = false) CommonModuleDto commonModuleDto);
}
